package com.mallcai.bigdata.ladon.service.report.impl.handler.support.rule;

import com.mallcai.bigdata.ladon.dpl.vo.DataType;

/**
 * @author feixy
 * @version 1.0
 * @date 2019-07-21 22:38
 */
public abstract class AbstractNumberRuleOperator extends AbstractNotCollectionRuleOperator {

    @Override
    public final boolean test(Object obj1, Object obj2) {
        if (!super.test(obj1, obj2)){
            return false;
        }
        return innerTest((Number) obj1, (Number) obj2);
    }

    protected abstract boolean innerTest(Number obj1, Number obj2);


    @Override
    public final DataType[] getSupportDataTypes() {
        return IRuleOperator.NUMBER_DATA_TYPE;
    }
}
